Electronic apparatus for the automatic composition and reproduction of musical data

ABSTRACT

An electronic apparatus for the automatic composition and reproduction of musical accompaniments and/or songs. The apparatus comprises a memory for storing a plurality of multi-track patterns containing musical data relating to songs and/or accompaniments of various styles; a selector is operable for controlling operational data tables on the basis of memorized program instructions, so as to select and read data of musical events on one or more data tracks, or parts thereof, in each of the selected pattern, as well as comprises operational program device for sequentially reading and composing the musical data contained in the data tracks of selected patterns, so as to make the number of musical measures and the temporal lengths of the selected data tracks uniform and to synchronize in real time the reading of data tracks having equal and/or different length, at points comprised in the real portion or in a virtual extension of each data track; the musical data of the tracks read in one pattern and the musical data of the tracks read in a successively selected pattern are therefore maintained in a musically consistent condition.

BACKGROUND OF THE INVENTION

The invention relates to an apparatus for the automatic composition andreproduction of musical data codified in digital form, by means of whichit is possible to freely compose and reproduce arrangements of rhythmicand/or melodic parts of accompaniments and/or songs of various styles,using pre-programmed musical data which can be collected from any datasource-inside and/or outside the apparatus, or which may be directlycreated by the same performer.

STATE OF THE ART

In an electronic musical instrument which uses an automatic recordingapparatus (sequencer) able to record and reproduce data, the variousmusical pieces or "patterns" relating to "songs" and/or accompanimentsof different musical "styles" are generally written and memorized onseveral parallel tracks to be subsequently reproduced in such a way thatthe performer is able to control them in an interactive manner and inreal time. At the present time, both the sequencers able to record andreproduce "songs" and the arrangers by means of which it is possible torecord and reproduce accompaniments in various musical styles, which canbe combined together in a significant manner during the executionthereof, make use of a data recording and reproduction method based onmulti-track systems, in which the lengths of the individual tracks mustbe identical to one another and be a whole multiple of a "bar" or of asame musical length.

Moreover, in the present-day systems, not only must the lengths of theindividual tracks of a musical pattern (number of bars) be identical toone another, but also the "time signature" (4/4, 3/4, etc.) must beidentical for the various tracks which make up the individual musicalpieces relating to the various instrument groups for each data patternto be recorded and/or reproduced. Therefore, with the known currentsystems, it is not possible to create songs and/or accompaniments ofvarying styles, collecting musical data from tracks of different lengthand/or with a different time signature or musical time since, in thecase of an interactive control, it would not be possible to obtain amusically consistent synchronization between the tracks. Systems of thiskind are described, for example, in U.S. Pat. No. 4,685,370 (Okuda etal).

From U.S. Pat. No. 5,457,282 (Miyamoto et al.) it is also known anautomatic accompaniment apparatus, in which a plurality of originalaccompaniment patterns relating to different accompaniment styles, whichare suitably pre-recorded, may be used to compose new patterns or newarrangements by collecting together the desired pattern parts which maybe composed to create a new accompaniment pattern which differs from theoriginal ones.

During the reproduction of the new pattern, pattern parts of differentlength and/or with a different time signature may be corrected tomaintain a musically consistent progression, while the new accompanimentpattern is automatically played. This patent merely proposes a differentsystem for composing accompaniment patterns, without providing theperformer with any possibility of intervening dynamically, in aninteractive manner, in order to select musical pieces or parts thereoffrom several groups of tracks of various available patterns, whileplaying, and modifying in real time the "style" of a song and/or anaccompaniment, in terms of its rhythm and/or melody, while maintaining asynchronized and musically consistent performance.

OBJECTS OF THE INVENTION

The general object of the invention is to provide an electronicapparatus for the automatic composition and reproduction of musical datacodified in digital form, by means of which the user is able to freelycompose and reproduce pre-stored musical patterns or patterns providedon purpose by the same performer, using accompaniment patterns and/orsongs with different styles which can be selected, combined andreproduced in real time, in a musically significant manner, while theyare being performed automatically. For the purposes of the presentdescription, the term "musical pattern" is understood as being the setof several musical phrases belonging to different instrument families,all of which have the same time signature and recorded or recordable onseveral parallel tracks having the same and/or different lengths, inwhich each phrase of each track consists of a succession of musical"events", for example notes, rests and/or other musical data which makeup the specific phrase of an instrument family.

Another object of the invention is to provide an electronic apparatusfor the automatic composition and reproduction of musical data, aspreviously referred to, by means of which it is also possible to usedata patterns having tracks of different length and/or data patternswith different styles and/or musical time with refrain points for eachtrack which can be memorized in a compacted form and repeatedly readover the entire length of the pattern or part thereof.

The apparatus according to the present invention therefore enablesmusical data to be collected from different sources and to be combinedin a musically consistent manner, so as to give the performer thepossibility of creating new songs and/or new styles by simply usingtracks of musical data from pre-existing data libraries. At the sametime it enables the time required for editing the musical data to bereduced substantially and offers the possibility of defining refrainsfor each musical track of the same length or of different length, thusallowing a substantial reduction in the musical data to be memorized anda consequent saving in the amount of the required memory.

Yet another object of the present invention is to provide an automaticaccompaniment apparatus which may be separate or forms part of anelectronic musical instrument.

As previously mentioned, in a traditional multi-track audio reproductionand/or recording system it is possible to have at one's disposal,located on the various tracks, different types of arrangement whichevolve simultaneously and parallely with one another, providing theoperator with the possibility of dynamically activating one or moretracks at the same time, as required, while keeping their synchronismunaltered.

In an electronic system managed by a CPU, however, it is extremelydifficult, owing to the reduced processing capacity of the CPU, tomanage simultaneously and in parallel the several patterns of musicaldata which represent the many variations in arrangement of a styleand/or a song.

Unlike traditional systems, the invention therefore relates to anelectronic apparatus in which the CPU manages a single pattern ofmusical data at a time, nevertheless providing the operator with thepossibility of dynamically activating reading of the many variations inarrangement which are made disposable, ensuring always synchronizationand sequential execution in a musically correlated manner.

According to a first aspect of the invention, an electronic apparatusfor the composition and the reproduction of musical data is provided,said apparatus comprising:

first read-only memory means (ROM) for memorizing a plurality of basicpatterns of musical data, in which each basic pattern comprises a set ofparallel tracks of musical data relating to different accompanimentstyles and/or songs of the same or of different lengths;

second read-and-write memory means (RAM); and

data pattern control and selection means for selecting and reading themusical data of one or more data tracks in each basic pattern recordedin said first memory means (ROM) and for transferring the musical dataof the basic patterns selected from said first memory means (ROM) tosaid second memory means (RAM);

as well as program means (CPU) comprising program instructions forsequentially composing and reading the musical data read from differentbasic patterns subsequently selected in said memory means, said programmeans (CPU) for composing and reading the musical data from the selectedbasic patterns comprising control means operative during reading of thedata, to make the number of musical measures and the temporal length ofthe data tracks of shorter length uniform with that of the longer datatrack in each basic pattern, and means (ALU) for synchronizing readingof the selected data patterns, to initiate, in real time, reading oftracks of equal and/or different lengths of a data pattern, from a pointcomprised in a real part or in a virtual extension of tracks of equaland/or different length for each selected pattern, maintaining amusically consistent condition for the musical data read in eachselected pattern and musical data read in a pattern selectedsubsequently.

According to a specific embodiment of the apparatus, the first memorymeans comprise a plurality of musical patterns relating to amultiplicity of variations for arrangement of different styles and/orsongs at the performer's disposal, which are memorized in two patterngroups, one group of which comprises a first set of loop patterndivisions, in which the musical data relating to a cyclically repeatablesuccession of musical events, also referred to as a succession of "basicevents" are memorized once only or in a "compacted" form in their trackso as to be read and cyclically reproduced, and in which the other groupof patterns comprises a second set of "one-shot" pattern divisionsformed by a non-cyclical succession of musical events which arememorized in their total extension and which are read and played onlyonce; and in which each pattern division in turn comprises differentmusical modes, for example "major", "minor" and "seventh", each composedfor example of eight tracks of equal and/or different length containingdata of musical events relating to the various associated instrumentfamilies.

According to a further feature of the invention, the data patterncontrol and selection means comprise a selecting device for selectingthe addressed of the musical data patterns and a pointer unit forreading, in each track, all the data and the codified musicalinformation, called "events" relating to the various time intervalsbetween each event and the associated durations which can be quantifiedas a number of "timing" or counting pulses, also called "clock" pulses(CPT) of the musical data memorized in said first and/or second memorymeans. This reading is performed on the basis of information supplied bythe pattern selection device and on the basis of information received ata MIDI IN serial port; in accordance with an instruction for programdata memorized in a zone of the ROM memory and on the basis of the countof a number of timing (clock) signals indicative of the distance betweenadjacent musical events and the distance of the event from the nextmusical bar, in each track, so as to command the repeated reading ofsaid cyclical data patterns and add musical rests in said non-cyclicaldata patterns, in comparison with the longest track in each pattern, aswell as on the basis of a calculation of the number of clock signals tobe counted for synchronization of reading of the data tracks ofdifferent patterns subsequently read.

According to a further feature of the apparatus according to theinvention, the musical data pattern reading unit can be connected tomusical tone generating means via a MIDI OUT serial port, toautomatically reproduce a song and/or a musical accompaniment forexample on the basis of information supplied by an apparatus forrecognizing the chords played on a musical keyboard, described forexample in U.S. Pat. No. 5,235,126 assigned to Roland.

According to a preferred embodiment, the means for synchronizing readingof the selected data patterns comprise an arithmetic calculating-unit(ALU) in a CPU programmed to perform division of the number of clocksignals which have lapsed from the start of reading of a musical track,by the number of clock signals contained in the bar or musical measureof the selected data pattern, assigning the value of the remainder ofthis division as the input of a counter unit for indicating the numberof clock signals to be skipped in order to synchronize a currentlyreading pattern with reading of a data pattern subsequently selected, sothat execution of the new selected pattern is performed from the pointwhich the said pattern would have reached if it had been readsimultaneously and in parallel with the current pattern.

BRIEF DESCRIPTION OF THE DRAWINGS

The electronic apparatus for the composition and reproduction of musicaldata according to the invention and its operating mode will be describedin greater detail hereinbelow, with reference to a preferred embodimentthereof and the accompanying drawings, in which:

FIG. 1 is a block diagram which shows in schematic form the electronicapparatus for the composition of musical data according to theinvention;

FIG. 2A is a schematic illustration of the group of data patterns readin a non-cyclical mode (one shot);

FIG. 2B is a schematic illustration of the group of data patterns readin cyclical mode (loop);

FIG. 3A shows in detail a pattern read in a non-cyclical mode;

FIG. 3B shows in detail a pattern read in a cyclical mode;

FIG. 4 is a musical example showing three typical configurations of abass instrument for the creation of a composition, in which musicalconfigurations of different types belonging to different patterns extendover four bars;

FIG. 5 shows how the three configurations of FIG. 4 can be musicallycompacted or reduced to a basic configuration;

FIG. 6 shows how it is possible to perform a composition of musical datapassing from a basic configuration of one pattern to anotherconfiguration of a pattern subsequently selected, using basicconfigurations memorized in a compacted form according to the example ofFIG. 5, while maintaining a musically consistent condition;

FIG. 7 is a flowchart illustrating the method of operation of theapparatus according to the invention, for reading a track of a musicalpattern in a non-cyclical mode (one shot);

FIG. 8 is a flowchart illustrating the operating mode of the apparatusaccording to the invention, for reading a track of a pattern in acyclical mode (loop);

FIG. 9 is a flowchart showing the operating mode of the apparatus in thecase of cross-reading of a track of a cyclical pattern and a track of anon-cyclical pattern;

FIG. 10 is a flowchart which shows the method of operation of theapparatus in the case of cross-reading of tracks of cyclical ornon-cyclical patterns.

DETAILED DESCRIPTION OF THE INVENTION

The general features of the electronic apparatus for the composition andreproduction of musical data according to the invention will be nowdescribed by making reference to the figures of the accompanyingdrawings.

As shown in FIG. 1, the apparatus comprises several functional blocksconnected together by a data processing and control unit 10, such as aCPU, comprising an arithmetic logic calculating unit ALU and a block 11which performs reading of data and information contained in the otherfunctional blocks of the apparatus.

In addition to the reading and pointer block 11, the apparatus comprisesa block 12 for selecting the patterns of the musical data contained in afirst ROM 02 read only memory 13A, which can be transferred into asecond RAM 02 random access memory 13B; the pattern selection block 12comprises moreover a control panel provided with switch circuitsnecessary for activating the various functions and for selecting thevarious parameter values, as well as a system for displaying theselected data.

The various musical data patterns stored in the memories 13A and 13B canin each case be read also through the control of a serial port MIDI IN14 which is able to receive, via Standard MIDI protocol, musical datamade available by external sources or control devices, such as forexample a musical keyboard, a floppy disk or other musical datagenerating means.

The ROM memory 13A in turn contains, in separate storing areas, aplurality of pre-memorized musical data patterns which are suitablysubdivided for example in accordance with the diagrams shown in FIGS. 2Aand 2B as well as the instructions and the program data for operation ofthe entire apparatus.

Reference 15 in FIG. 1 shows a functional block containing a timing orclock signal generator, the frequency of which can be adjusted via asuitable potentiometer, by means of which it is possible to set the"Tempo", i.e. the speed at which the variously selected musical piecesare played. Reference 16 in FIG. 1 shows also a mass storage memory ofthe apparatus.

The apparatus comprises moreover several counters for counting the clockpulses emitted by the generator of the block 15, which are intended toperform various functions; more precisely it comprises a counter C, foreach pattern track, which counts the clock pulses used to determine thedistance between two successive musical events on a same track; thiscounter in practice, at the speed set by the clock signals generated bythe block 15, decreases or decrements the value of the number of theclock or CPT signals of the data patterns contained in the memories 13A,13B read by the reading block 11 when the decremental or counting downreaches the value zero; the reading block 11, on the basis of theprogram data instruction, by its pointer reads the next event containedin the same track of the current pattern. The apparatus furthermorecomprises a counter B for counting the clock pulses used to determinethe distance of the musical event read first in a bar, from the startpoint of the next musical bar; in practice the counter B decreases thevalue of the number of clock pulses (CPT) set as from the value of thetiming or clock pulses (CPT) for the individual musical bar, at thespeed set by the block 15, i.e. the number of clock pulses (CPT) whichseparate the last event read by the reading block 11, from the start ofthe next bar. Finally, the apparatus comprises a third counter A isprovided for counting the clock pulses used for synchronizing thereadings of the various data patterns which are dynamically selected.

A serial port MIDI OUT 17 may be connected to an external musical tonegenerator for converting into musical sounds various events of the datapatterns read from the memories 13A and/or 13B.

With reference now to FIGS. 2A to 6, we shall describe the proceduresfor memorizing and reading the data contained in the individual patternsof the memories 13A and 13B.

As is known, there are substantially two ways of creating new styles,i.e. creating them from new or editing existing styles by altering ormodifying the setting of musical data or the required notes. In bothcases, according to the present invention, it is possible to reduce to aminimum the programming time since the apparatus, although managing viathe CPU a single data pattern at a time, nevertheless allows theoperator to memorize only the main parts of each pattern and to entirelyread each individual track or only a part thereof, by dynamicallyactivating, in real time, the reading of the variations in availablearrangement, ensuring that the transition of the execution from onemusical pattern to the pattern selected next is always performed from a"real" or "virtual" point which the next selected pattern has reached orwould have theoretically reached if it had been written in full and readsimultaneously and in parallel with the current one.

More precisely, as shown in FIGS. 2A and 2B, the various musicalpatterns which represent the many arrangement variations of stylesand/or songs available, are represented by various patterns which can begrouped into two main categories, referred to as "divisions" whichcomprise a first group of patterns performed only once also called "oneshot patterns", and a second group of patterns performed cyclically,also called "looped patterns". Within each category of patterns furthersubdivisions, identifying specific musical applications thereof, aremade possible.

For example, in the case shown in FIG. 2A, the non-cyclical or one-shotpattern category is divided up into four divisions, i.e. a first "Intro"division and a second "Ending" division which are establishing thebeginning and the end of a musical piece or composition, as well as theFO (Fill in to Original) and FV (Fill in to Variation) divisions whichindicate the start of new musical parts of an original pattern or avariation thereof.

On the other hand the looped pattern category is divided up into twobasic divisions, called "Original" and "Variation", as shown in FIG. 2B.Each division of both the categories, in turn, may be composed of twotypes of pattern arrangements called "Basic" and "Advanced". Moreover,each type of pattern has moreover three harmonization "modes", typicallycalled "Major mode" (M), "Minor mode" (m) and "seventh" (7). Overall,therefore, there are thirty six patterns or divisions which arediffering for the style, each of which can be selected by dedicatedkeys, on the panel of the control block 12 and showing the correspondingwording, or by data supplied by an apparatus external to the MIDI INserial port.

Each pattern of musical data, as already mentioned, is finally dividedup into several parallel "tracks", each track containing a set ofmusical data and/or information, said "events" which may be classifiedinto various associated instrument families; an example is shown inFIGS. 3A and 3B, both for the tables read in a one-shot mode (Intro,Ending, FO, FV) and for the tables read in a looped mode (Original andVariation). As shown, in general there are eights tracks per pattern,indicated by ADR for the drum or percussion accompaniment; ABS for thebass accompaniment; and AC1, AC2, AC3, AC4, AC5 and AC6 for thedifferent melodic accompaniments which can be selected by the operator.

Each track which composes a mode, of a type, of a division, of a styleor song, may have a typical musical length, equal to or different fromthat of the other tracks. In FIG. 3A the lines in bold indicate the reallength of each individual track, expressed in musical measures or bars,while the broken lines represent the added rests which, in this case,are calculated depending on the longest track of the tracks of a samedata pattern.

Correspondingly, in the looped pattern of FIG. 3B, the lines in boldindicate, again in musical measures or bars, the real length of thetracks, while the symbol shown at the end of each track represents thereal or virtual loop point, from where each track of the pattern isautomatically re-read from the start, in an entirely independent mannerfrom the other tracks of the same pattern, until reading of the longesttrack is terminated.

Reading of the individual data patterns by the reading and pointer block11 indicated in FIG. 1 differs according to the associated category,i.e. depending on whether it is a pattern which can be readnon-cyclically (one shot pattern) or cyclically (looped pattern).

The above will be clarified in more detail hereinbelow with reference tothe musical example of FIG. 4 showing three musical configurations,typical of bass instruments, which are memorized in different patternsfor the creation of a new track of a musical data pattern in accordancewith the operating mode of the apparatus according to the invention.

The musical configurations for the track of type M, m and 7 consist ofan extension of four musical bars.

In particular, in the M type track there is a basic musical phrasecomposed of the succession of two different musical bars A and B whichare repeated several times on the same track; on the other hand, in them type track there is a repetitive succession of musical bars of thesame type C which, in certain cases, could also be a sub-multiple of abar or a simple event.

Finally, on the seventh type track there are four musical bars ofdifferent types D, E, F and G which complete the track.

In order to save memory space and reduce the time required for creatingthe musical composition and for entering the musical data in the memory,compaction or reduction of the length of the tracks of the M and mmusical patterns of the looped type is performed, without altering themusical significance thereof, also to the advantage of a greaterflexibility of composition during the manipulation stages which aretypical of a collage. This is performed by memorizing only the two basicbars A and B of the M type track as well as the single basic bar C forthe m type track; on the other hand, the four bars D, E, F and G of theone-shot or seventh type track are memorized subsequently in theirentirety; in practice the M type track is compacted, i.e. is reduced tothe extension of two cyclically repeatable measures, the m type track isreduced or compacted to the extension of a single measure, againcyclically repeatable, while the seventh type track, which cannot becompacted, it remains over the entire extension of four bars.

Again with reference to the musical example of the preceding FIGS. 4 and5 and the subsequent FIG. 6, a description will now be given as to howit is possible to pass in a synchronized manner from a track to anotherone, whether it be from a position in the real section shown unshaded inFIG. 6 or in a virtual extension necessary for completing the missingmeasures or bars, in order to obtain theoretically identical tracklengths, as shown by the broken lines in the same FIG. 6.

As previously mentioned, the CPU is able to manage a single data patternat a time; however, according to the present invention, the apparatus isprogrammed so as to give the operator the possibility, nevertheless, ofdynamically activating reading of the available arrangement variations,while reading of a pattern is in progress, ensuring that the transitionof the execution from the current pattern to the next selected oneoccurs in real time from a point contained in the real or virtualextension of the track of the pattern i.e., in the case of the virtualextension, from a point which the said pattern track would have reachedif it had been entirely written or not compacted or reduced, existingfor the entire natural duration.

This is clarified more fully in FIG. 6 which shows how it is possible toeffect a transition from a track of one pattern to a track of anotherpattern, obtaining a path of the typeA(M)-C(m)-C(m)-B(M)-E(7)-F(7)-C(m)-A(M)-B(M)-G(7)-C(m)-B(M), where thehatched zones indicate the missing track parts, since compacted orreduced, as previously described with reference to FIGS. 4 and 5. Thetransition from one track to another at the points indicated by thearrows is performed under the control of the synchronization counter A,on the basis of the data supplied by the calculating unit ALU, as can beseen from the following flowcharts. With reference to FIG. 7, theoperating mode of the apparatus on the basis of the flowchartillustrating reading of a track of a one-shot pattern will be firstlydescribed.

At the start, after activating the switch for start-up of the procedure,provided on the special control panel of the selection block 12, the CPUinitializes the various counters, in particular the synchronizationcounter A with the value 0 (step S1), the counter B with the value "L"of the clock pulses contained in a musical bar used for calculating thedistance of an event from the next musical bar (step S2), and thecounters C of the clock pulses used for determining, in each individualtrack, the distance between two successive musical events, with thevalue 1 (step S3); with the first decrement of the counter C (step S11),the reading block 11 of the CPU reads the first event in a specifictrack of a pattern selected from the ROM memory 13B and/or from the RAMmemory 13A via the control panel 12 of FIG. 1 depending on whether apre-memorized (ROM) or composed (RAM) pattern is to be performed. Thetrack-end flag is moreover set to 0 (step S4) in order to indicate thatthe track-end event has not yet been read by the block 11 of the CPU.

The pointer contained in the reading block 11 provides in succession thereading data of the various musical events of each track of a patternand it is therefore automatically positioned on the first event of thetrack of the selected pattern (step S5). At this point the CPU waits fora clock signal (CPT) generated by the timing pulse generating block 15(step S6) with which the reading speed has also been set.

Once the timing signal (CPT) has been received, the CPU increments byone the synchronization counter A (step S7) in order to indicate that atime equal to one clock pulse (CPT) has lapsed and at the same timedecrements by one the counter B (step S8) in order to indicate that thedistance from the next bar is correspondingly diminished by one clockpulse (CPT).

If the counter B has reached "0" (step S9) and if the track-end eventhas already been read for each of the tracks which make up the pattern(step S18), reading of the non-cyclical or one-shot pattern is alsoterminated.

If the track-end event has not been read for each of the tracks whichmake up the pattern (step S18), the counter B is reset to the initialvalue L (step S19).

On the other hand, if the counter B has not reached "0" (step S9) and ifthe track-end event has already been read for each of the tracks whichmake up the pattern (step S10), the reading block 11 reads no furtherevents, thus inserting musical rests for each track until the startsignal of the next bar; in this way the end of execution of thenon-cyclical pattern is determined.

On the other hand, if the counter B has not reached "0" (step S9) and ifthe track-end event has not been read for each of the tracks which makeup the pattern (step S10), the CPU decrements by one the counter C (stepS11) and, only when the value "0" is reached (step S12), does thereading block 11 read the event which has been subsequently indicated bythe pattern track pointer (step S13).

If the read event is a track-end event (step S14), the track-end flag isset to 1 (step S20) so as to insert a musical rest until the next barstart signal following the readings of the track-end event of thelongest tracks; in this way execution of the non-cyclical pattern isterminated.

On the other hand, if the event read is not a track-end event, the CPUprocesses and sends it, via standard MIDI protocol, to the MIDI OUTserial port 17 (step S15); the time value contained in the event read,indicating the number of clock or timing pulses (CPT) which separate itfrom the next event, is now entered in the counter C (step S16). At thispoint the track pointer is positioned on the event following the oneread (step S17).

With reference to FIG. 8 we shall now describe the reading of a track ofa looped cyclical pattern.

When the procedure start switch is activated on the control panel of themusical data pattern selection block 12, the CPU initializes thefollowing counters: counter A to the value "0" (step U1), while eachcounter C is set to the value 1 (step U2) so that, at the firstdecrement of the counter B (step U6), the reading block 11 of the CPUreads the first event of the ROM memory 13B (step U8) and/or of the RAMmemory 13A.

The pointer contained in the block 11 is then positioned on the firstevent of the track of the musical data pattern selected, contained inone of the two memories ROM 13A and/or RAM 13B (step U3).

The CPU waits for a clock signal (CPT) generated by the block 15 (stepU4) and, once this signal has been received, the CPU increments thecounter A by 1 (step U5) so as to indicate that a time instantcorresponding to a CPT has lapsed.

The CPU continues to decrement the counter C and, only when the value"0" is reached (step U7), does the reading block 11 read the next eventindicated by its pointer (step US). If the event read is a track-endevent (step U9), the CPU returns to the step U2 so as to repositionitself on the first event of the track of the musical data pattern,starting a new read cycle.

If the read event is not a track-end event, the CPU processes and sendsit, via Standard MIDI protocol, to the serial port MIDI OUT 17 (stepU10) for execution thereof.

The time value contained in the read event, indicating the number ofclock signals (CPT) which separates it from the next event, is nowentered in the counter C (step U11); at this point the track pointer ispositioned on the event following the one already read (step U12).

The flowchart in FIG. 9 describes, on the other hand, the transitionfrom reading of a track of a cyclical pattern to a track of anon-cyclical pattern.

When, in a given instant, the block 12 of the musical data patternselector or the MIDI IN serial port 14 communicates a read address of atrack of a non-cyclical data pattern, different from the one currentlyselected, the CPU 10 synchronizes the transition from one track of apattern to that of another, calculating for each track the position ofthe event from where starting the reading of the track in thenon-cyclical pattern; in the next step V1, the CPU 10, via itsarithmetic calculating unit ALU, divides the number "A" of the clocksignals (CPT) which have lapsed from the moment when reading of thepattern is started, by the number "L" of clock signals (CPT) containedin a musical bar. The remainder R of this division is the new value ofthe counter A in number of clock signals (CPT) which indicates thenumber of signals (CPT) to be skipped from the start of the cyclicalpattern which is read after the non-cyclical one.

If the value of R is greater than the number M of the clock signals(CPT) contained in the entire track of the pattern (step V2), thetrack-end indicator is set to the value 1 (step V5) so as to indicatethat the track-end of the non-cyclical pattern has been reached.

If the value R, on the other hand, is less than or equal to the number M(step V2), the pointer is positioned on the first event of the track ofthe cyclical pattern and the reading block 11 reads all the events ofthe track of the pattern until it reaches a number of clock signals(CPT) equal to the value R (step V3).

The value R is then assigned to the counter A (step V4) and execution iscontinued until step S6 of the flowchart shown in FIG. 7, for readingthe track of the non-cyclical pattern (reference B).

FIG. 10 shows, finally, the flowchart describing the transition fromreading of a track of a cyclical pattern to reading of a track of adifferent cyclical pattern, or a track of a non-cyclical pattern to atrack of another non-cyclical pattern.

In this case, when the block 12 of the musical data pattern selector orthe MIDI IN serial port 14 communicates a read address of a datapattern, for example of the cyclical type, different from the onepreviously selected one, the CPU synchronizes the transition between thetwo patterns, calculating the position of the event from where readingof the new pattern is to be subsequently started.

In step T1, the CPU, by means of its mathematic calculating unit ALU,divides the number of timing signals (CPT) which have lapsed from thestarting of the reading, by the number M of clock signals (CPT)contained in the entire track of the pattern. The remainder R of thisdivision is the new value of the counter A expressed as the number ofclock pulses which indicate the number of pulses (CPT) to be skippedfrom the start of reading of the track of the new cyclical pattern.

The pointer is therefore positioned on the first event of the track ofthe new cyclical pattern (step T2) and the reading block 11 reads allthe events of the pattern track until it reaches a number of timingpulses equal to the value R of the remainder (step T3).

At this point, execution can continue up to step U4 (Reference A) inaccordance with the flowchart for reading a track of a cyclical pattern,shown in FIG. 8.

What is claimed is:
 1. An electronic apparatus for the composition andreproduction of musical data comprising:memory means for storing aplurality base patterns of musical data, in which each base patternconsists of a set of parallel tracks containing musical data relating todifferent songs and/or accompaniment styles, and in which said datatracks in each pattern have a same or different lengths which extendover a given number of musical bars; data pattern selection and controlmeans for selecting and reading the musical data of one or more datatracks in each pattern in said memory means; as well as program meanscomprising program instructions for reading and sequentially composingthe musical data from different selected patterns and subsequently readfrom said memory means, said programming means for the composition andreading of the musical data of the selected patterns comprising: controlmeans operative during data reading, for conforming the number ofmusical bars and the temporal length of the data tracks of shorterlength, to the number of musical bars and the lengths of the longestdata track in each base pattern, and means for synchronizing reading ofthe data patterns selected so as to start, in real time, the reading oftracks of equal or different length of a data pattern, from a pointcomprised in a real part or in a virtual extension of tracks of equaland/or different length of each pattern selected from said memory means,maintaining in a musically consistent condition the musical data read ineach selected pattern and the musical data read in a subsequentlyselected pattern.
 2. An apparatus according to claim 1, in which thememory means comprise a plurality of musical patterns relating to amultiplicity of arrangement variations for different styles and/orsongs, memorized in two pattern groups, of which one group comprises afirst set of pattern divisions, in which the musical data relating to acyclically repeatable succession of musical events are memorized onlyonce or in a "compacted" form so as to be read and cyclicallyreproduced, and in which the other group of patterns comprises a secondset of pattern divisions formed by a non-cyclical succession of musicalevents, which are memorized in their total extension and which are readand played once only; and in which each pattern division in turncomprises different musical modes, such as "major", "minor" and"seventh" each one composed of several tracks of equal and/or differentlength containing the data of musical events relating to variousassociated instrument groups.
 3. An apparatus according to claim 1, inwhich the data pattern selection and control means comprise an addressselecting device for selecting the read addresses of the musical datapatterns, and a pointer unit for reading the musical data tracks of thepatterns memorized in said memory means; and in which said patternselection means comprise a MIDI IN port.
 4. An apparatus according toclaim 3, in which the musical data pattern read unit is connected tomeans for generating musical tones via a MIDI OUT serial port.
 5. Anapparatus according to claim 1, comprising counting signal generatingmeans for generating signals for counting the duration and the distancesbetween musical events of the pattern tracks, in which the means forsynchronizing reading of the tracks of the selected data patternscomprise an arithmetic calculating unit programmed for performingdivision of the number of counting signals lapsed from the start of apattern reading, by the number of counting signals contained in eachmusical bar of a selected non-cyclical data pattern, or by the number ofcounting signals contained in the entire track of a selected cyclicalpattern, assigning the value of the remainder of this division as thevalue for a /counting device designed to indicate the number of countingsignals to be skipped in order to synchronize the current reading of adata pattern track with the reading of a subsequently selected datapattern track.
 6. An apparatus according to claim 1, in which said meansfor memorizing the musical data patterns comprise a read only memory(ROM) containing pre-memorized data patterns.
 7. An apparatus accordingto claim 1, in which said data pattern memory means comprise aread-and-write memory (RAM) for the composition of new musical datapatterns.
 8. An electronic musical instrument in combination with anelectronic apparatus for the automatic composition and reproduction ofdata according to claim 1, in which said electronic musical instrumentcomprises tone generating means for the automatic generation of musicaltones connected to said MIDI OUT port.